//
//  PayMoneyTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/12.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "PayMoneyTableViewCell.h"

@implementation PayMoneyTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self creatUI];
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.moneyLabel];
    [self.contentView addSubview:self.detailLabel];
}

-(UILabel *)timeLabel
{
    if (_timeLabel == nil) {
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(17, 10, WIDTH - 30, 20)];
        _timeLabel.font = font(12);
        _timeLabel.textColor = SFMColor(153, 153, 153);
        _timeLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _timeLabel;
}

-(UILabel *)moneyLabel
{
    if (_moneyLabel == nil) {
        _moneyLabel= [[UILabel alloc] initWithFrame:CGRectMake(15, 37, WIDTH/2, 20)];
        _moneyLabel.font = font(16);
        _moneyLabel.textColor = SFMColor(245, 109, 35);
        _moneyLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _moneyLabel;
}

-(UILabel *)detailLabel
{
    if (_detailLabel == nil) {
        _detailLabel= [[UILabel alloc] initWithFrame:CGRectMake(WIDTH - 75, 37, 60, 20)];
        _detailLabel.font = font(10);
        _detailLabel.layer.cornerRadius = 10;
        _detailLabel.textAlignment = NSTextAlignmentCenter;
        _detailLabel.clipsToBounds = YES;
    }
    return _detailLabel;
}

-(void)send
{
    self.timeLabel.text = @"2018年11月期";
    self.moneyLabel.text= @"￥10000.00";
    NSString * str = @"已交";
    self.detailLabel.text = str;

    //逾期未交
//    self.detailLabel.backgroundColor = SFMColor(255, 0, 27);
//    self.detailLabel.textColor = SFMWhiteColor;
    
    self.detailLabel.backgroundColor = SFMColor(209, 242, 213);
    self.detailLabel.textColor = SFMColor(36, 191, 36);

}

-(void)sendoverDueNoPayModel:(overDueNoPayModel *)model
{
    self.timeLabel.text = model.busreceivemonth;
    self.moneyLabel.text= [NSString stringWithFormat:@"￥%@",model.nyreceivable];
    NSString * str = @"已逾期";
    self.detailLabel.text = str;
    //逾期未交
    self.detailLabel.backgroundColor = SFMColor(255, 0, 27);
    self.detailLabel.textColor = SFMWhiteColor;
}

-(void)sendHistoryPayModel:(HistoryPayModel *)model
{
    self.timeLabel.text = model.busreceivemonth;
    self.moneyLabel.text= [NSString stringWithFormat:@"￥%@",model.nyreceivable];
    NSString * str = @"已交";
    self.detailLabel.text = str;
    self.detailLabel.backgroundColor = SFMColor(209, 242, 213);
    self.detailLabel.textColor = SFMColor(36, 191, 36);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
